// AutoCADGMS.h: interface for the AutoCADGMS class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_AUTOCADGMS_H__9387502D_34AE_481A_B2F2_162500A93568__INCLUDED_)
#define AFX_AUTOCADGMS_H__9387502D_34AE_481A_B2F2_162500A93568__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "GraphicModelSpace.h"
#include <dbmain.h>
#include <acdocman.h>
#include "dbdict.h"
#include "SHObserverManager.h"

class AutoCADGMS : public GraphicModelSpace  
{
public:
	AutoCADGMS();
	virtual ~AutoCADGMS();

public:
	virtual BOOL Save();
	virtual BOOL Close();
	virtual void Update();
	void SaveDwg();

public:
	void Database(AcDbDatabase* pDB);
	AcDbDatabase* Database() const {
		return m_pDatabase;
	}

	AcApDocument* Document() const {
		return m_pDocument;
	}

	void Document(AcApDocument* pDoc){
		m_pDocument = pDoc;
	}

	AcDbDictionary* GetSHDictionary();
	void ZoomOutPHS(SupportHanger* pSH);
	BOOL GetSHObserver(SHPoint& pt, SupportHanger* pSH);

	SHObserverManager& GetSHObserverManager(){
		return m_theObservers;
	}

	static AutoCADGMS* GetCurGMS();
public:
	void ReadObserver();

	static CString m_strSHLayerName;

private:
	BOOL LegalSH(SupportHanger* pSH);

private:
	AcDbDatabase* m_pDatabase;
	AcApDocument* m_pDocument;
	SHObserverManager m_theObservers;
};

#endif // !defined(AFX_AUTOCADGMS_H__9387502D_34AE_481A_B2F2_162500A93568__INCLUDED_)
